public class Librarian {
    private String name;
    private int quantity;
    private double price;

    public Librarian(String n, int q, double p) {
        name = n;
        quantity = q;
        price = p;
    }

    public double calcTotalPrice(int orderQuantity) {
        return orderQuantity * price;
    }

    public static void main(String[] args) {
        Librarian b1 = new Librarian("小王子", 10000, 58.6);
        Librarian b2 = new Librarian("红楼梦", 56900, 39.5);

        int order1 = 1000;
        double total1 = b1.calcTotalPrice(order1);
        System.out.println(b1.getName() + "共有" + b1.getQuantity() + "本，一本价格为：" + b1.getPrice());
        System.out.println("订购" + order1 + "本为" + total1 + "元");

        int order2 = 6000;
        double total2 = b2.calcTotalPrice(order2);
        System.out.println(b2.getName() + "共有" + b2.getQuantity() + "本，一本价格为：" + b2.getPrice());
        System.out.println("订购" + order2 + "本为" + total2 + "元");
    }

    public String getName() {
        return name;
    }

    public int getQuantity() {
        return quantity;
    }

    public double getPrice() {
        return price;
    }
}
